package com.m;

import com.m.rule.LoginDim;
import com.m.rule.RuleLoader;

import java.util.ArrayList;
import java.util.List;

/**
 * 功能: <br/>
 *
 * @author miracle
 */
public class Main {
    public static void main(String[] args) throws Exception {
        RuleLoader ruleLoader = RuleLoader.getInstance();
        IRule rule = ruleLoader.getIRuleFromPackage("C:\\Users\\miracle_j\\Desktop\\temp\\LoginRule.groovy");
//        LoginRule rule = new LoginRule();
        List<LoginDim> loginDims = new ArrayList<>();
        loginDims.add(new LoginDim("15195957503", 10));
        loginDims.add(new LoginDim("15195957501", 1));
        loginDims.add(new LoginDim("15195957509", 100));
        loginDims.add(new LoginDim("443955274@qq.com", 1));
        loginDims.add(new LoginDim("443955275@qq.com", 100));
        loginDims.add(new LoginDim("12345", 2));
        loginDims.add(new LoginDim("12346", 100));
        for (LoginDim loginDim : loginDims) {
            if (rule.hitRule(loginDim)) {
                System.out.println(loginDim);
            }
        }
    }
}
